﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ServiceModel.DomainServices.Client;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace Candy.Model
{
    public class CandySubmitOperation : CandyOperationBase
    {

        public ReadOnlyCollection<Entity> AddedEntities { get; private set; }
        public ReadOnlyCollection<Entity> ModifiedEntities { get; private set; }
        public ReadOnlyCollection<Entity> DeletedEntities { get; private set; }

        public IEnumerable<Entity> EntitiesInError { get; private set; }

        public CandySubmitOperation(SubmitOperation submitOperation) : base(submitOperation)  
        {
            
           EntitiesInError = submitOperation.EntitiesInError;
           AddedEntities = submitOperation.ChangeSet.AddedEntities;
           ModifiedEntities = submitOperation.ChangeSet.ModifiedEntities;
           DeletedEntities = submitOperation.ChangeSet.RemovedEntities;
        }

        public CandySubmitOperation(IEnumerable<Entity> entitiesInError, Exception error, ReadOnlyCollection<Entity> addedEntities,ReadOnlyCollection<Entity> modifiedEntities,ReadOnlyCollection<Entity> deletedEntities ) : base(error)
        {
            EntitiesInError = entitiesInError;
            AddedEntities = addedEntities;
            ModifiedEntities = modifiedEntities;
            DeletedEntities = deletedEntities;
        }

    
    }


}
